namespace CSharpPro._1028;
using System;
public class Demo
{
    public static void RunUserAuthDemo()
    {
        IUserService userService = new UserServiceImpl();

        // 模拟注册
        userService.Register(new User("zhangsan", "123456", "zhangsan@example.com"));
        userService.Register(new User("lisi", "654321", "lisi@example.com"));
        userService.Register(new User("zhangsan", "abc123", "zs@example.com")); // 用户名重复，注册失败

        // 显示所有用户
        userService.ShowAllUsers();

        // 模拟登录
        Console.WriteLine("\n=== 尝试登录 ===");
        userService.Login("zhangsan", "123456"); // 成功
        userService.Login("lisi", "123456");     // 密码错误
        userService.Login("wangwu", "123456");   // 用户不存在
    }
}